home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cfengine-1.5.3 / src / cfd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-21  |  3.7 KB  |  138 lines

  1. /* cfengine for GNU
  2.  
  3.         Copyright (C) 1995
  4.         Free Software Foundation, Inc.
  5.  
  6.    This file is part of GNU cfengine - written and maintained 
  7.    by Mark Burgess, Dept of Computing and Engineering, Oslo College,
  8.    Dept. of Theoretical physics, University of Oslo
  9.  
  10.    This program is free software; you can redistribute it and/or modify it
  11.    under the terms of the GNU General Public License as published by the
  12.    Free Software Foundation; either version 2, or (at your option) any
  13.    later version.
  14.  
  15.    This program is distributed in the hope that it will be useful,
  16.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.    GNU General Public License for more details.
  19.  
  20.    You should have received a copy of the GNU General Public License
  21.    along with this program; if not, write to the Free Software
  22.    Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  23.  
  24.  
  25. /*******************************************************************/
  26. /*                                                                 */
  27. /*  HEADER for cfd - Not generically includable!                   */
  28. /*                                                                 */
  29. /*******************************************************************/
  30.  
  31. extern FILE *yyin;
  32.  
  33. #define queuesize 20
  34. #define connection 1
  35. #define CFD_INPUT "cfd.conf"
  36. #define CFD_SOURCE 1
  37. #define RFC931_PORT 113
  38.  
  39. /**********************************************************************/
  40.  
  41. char *COMMANDS[] =
  42.    {
  43.    "EXEC",
  44.    "AUTH",  /* old protocol */
  45.    "GET",
  46.    "OPENDIR",
  47.    "SYNCH",
  48.    "CLASSES",
  49.    "MD5",
  50.    "SMD5",
  51.    "CAUTH",
  52.    "SSYNCH",
  53.    "SGET",
  54.    NULL
  55.    };
  56.  
  57. enum COMMS
  58.    {
  59.    cfd_exec,
  60.    cfd_auth,
  61.    cfd_get,
  62.    cfd_opendir,
  63.    cfd_synch,
  64.    cfd_classes,
  65.    cfd_md5,
  66.    cfd_smd5,
  67.    cfd_cauth,
  68.    cfd_ssynch,
  69.    cfd_sget,
  70.    cfd_bad
  71.    };
  72.  
  73. struct cfd_connection
  74.    {
  75.    int id_verified;
  76.    int synchronized;
  77.    int maproot;
  78.    int sd_reply;
  79.    char hostname[maxvarsize];
  80.    char username[maxvarsize];
  81.    char signature[9];
  82.    char ipaddr[20];
  83.    char output[bufsize*2];   /* Threadsafe output channel */
  84.    };
  85.  
  86. struct cfd_get_arg
  87.    {
  88.    struct cfd_connection *connect;
  89.    int secure;
  90.    char key[8];     /* DES key */
  91.    int buf_size;
  92.    char *replybuff;
  93.    char *replyfile;
  94.    };
  95.  
  96. /*******************************************************************/
  97. /* GLOBAL VARIABLES                                                */
  98. /*******************************************************************/
  99.  
  100. int CLOCK_DRIFT = 3600;   /* 1hr */
  101. int CFD_MAXPROCESSES = 0;
  102. int ACTIVE_THREADS = 0;
  103. int NO_FORK = false;
  104. int MULTITHREAD = false;
  105. int CHECK_RFC931 = false;
  106. int CFD_INTERVAL = 0;
  107. int DENYBADCLOCKS = true;
  108.  
  109. struct option CFDOPTIONS[] =
  110.    {
  111.    { "help",no_argument,0,'h' },
  112.    { "debug",optional_argument,0,'d' }, 
  113.    { "verbose",no_argument,0,'v' },
  114.    { "no-fork",no_argument,0,'F' },
  115.    { "parse-only",no_argument,0,'p'},
  116.    { "multithread",no_argument,0,'m'},
  117.    { NULL,0,0,0 }
  118.    };
  119.  
  120. /*******************************************************************/
  121. /* PARSER                                                          */
  122. /*******************************************************************/
  123.  
  124. char CFRUNCOMMAND[bufsize];
  125. time_t CFDSTARTTIME;
  126.  
  127. #ifdef RE_DUP_MAX
  128. # undef RE_DUP_MAX
  129. #endif
  130.  
  131. /*******************************************************************
  132.  * Sunos4.1.4 need these prototypes
  133.  *******************************************************************/
  134.  
  135. #if defined(SUN4)
  136. extern char *realpath(/* char *path; char resolved_path[MAXPATHLEN] */);
  137. #endif
  138.